#include "ddeviceinformation.h"
#include <QDebug>

#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(QT_SIMULATOR) || defined(MEEGO_EDITION)  || defined(UI_TABLET)
#define MY_MOBILITY
#include <QtSystemInfo/QSystemInfo>
QTM_USE_NAMESPACE
#endif

DDeviceInformation::DDeviceInformation(QObject *parent) :
    QObject(parent)
{
}

#if defined(QTM_USE_NAMESPACE)
QString DDeviceInformation::getStyleName(){
    QSystemInfo sys;
    qDebug()<< sys.version(QSystemInfo::Os);
    if (isTouchable()){
        return ":/dbrowser/touchable.qss";
    }
    else{
        return ":/dbrowser/default.qss" ;
    }
}

bool DDeviceInformation::isTouchable(){
    QSystemInfo sys;
#if defined(UI_TABLET)
    return true;
#endif
    return sys.hasFeatureSupported(QSystemInfo::HapticsFeature) || sys.version(QSystemInfo::Os).contains("MeeGo");
}

#else
QString DDeviceInformation::getStyleName(){
    return ":/dbrowser/default.qss" ;
}

bool DDeviceInformation::isTouchable(){
    return false;
}
#endif
